<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const str = "abc123efg456";
      console.log(str.match(/[^123]/g)); //取反
      console.log(str.match(/\D/g)); // [^0-9] [^\d]
      console.log(str.match(/\W/g)); // [^0-9a-zA-Z_] [^\W]
    </script>
  </body>
</html>
